<template>
	<div class="index">
		<!-- 吸顶搜索栏-->
		<search-small ref="searchSmall" v-if="jdShowSearch"></search-small>
		<!--搜索-->
		<div class="header">
			<search ref="search"></search>
			<banner-swiper ref="banner"></banner-swiper>
		</div>
		<!--商品列表-->
		<goods ref="goodsList"></goods>
	</div>
</template>

<script>
import store from 'store';
import { SearchSmall, Search, Goods, BannerSwiper } from './components';
import { mapGetters } from 'vuex';

export default {
	name: 'index',
	components: {
		SearchSmall,
		Search,
		BannerSwiper,
		Goods
	},
	data() {
		return {
			isRefresh: false,
			shareTemplate: []
		};
	},
	computed: {
		...mapGetters(['userInfo', 'jdShowSearch'])
	},
	async created() {},
	mounted() {
		// 搜索滑动监听
		// window.addEventListener('scroll', this.scrollPage, true);
	},
	activated() {
		if (store.get('token')) {
			this.$store.dispatch('GET_USERINFO');
		}
	},
	methods: {}
};
</script>

<style lang="scss" scoped>
.index {
	padding-bottom: 100px;
	background-color: #f6f7fa;
	.header {
		width: 100%;
		height: 380px;
		overflow: hidden;
		background: url('../../assets/images/jd/header.png') no-repeat;
		background-size: 100% 250px;
	}
}
</style>
